<?php
/**
 * View parcial para um campo categoria (tabela relacionada) na lista admin
 * @param campo
 * @param valor
 * @param categorias
 */
$valor = $this->valor;
$campo = $this->campo;
$cabecalho = $this->cabecalho;
$categorias = $this->categorias;

$ids = explode(',', $valor);
$nomes = array();

$hint = $this->hint;
foreach ($ids as $id) {
	$nomes[] = $categorias[$id];
}
?>
<label for="<?php echo $campo; ?>"><?php echo $cabecalho; ?></label>
<input class="text-input large-input {validate: {required: <?php echo (isset($this->required) && $this->required == false) ? 'false' : 'true'; ?>}}" type="text" value="<?php echo implode(', ', $nomes);?>" name="<?php echo $campo;?>" />
<?php 
if(!empty($hint)){
?>
<small class="hint"><?php echo $hint;?></small>
<?php 
}
?>